package com.tansun.easycare.rule.ruletest.service;

import java.util.List;
import java.util.Map;

import com.tansun.easycare.rule.common.service.RuleBaseService;
import com.tansun.easycare.rule.exception.BizException;
import com.tansun.easycare.rule.ruletest.entity.RuleTest;
import com.tansun.easycare.rule.ruletest.model.RuleBatchResult;
import com.tansun.easycare.rule.ruletest.model.RuleTestMap;
import com.tansun.easycare.rule.ruletest.model.RuleTestVO;
import com.tansun.easycare.rule.ruletest.model.TestDataModeVO;
import com.tansun.rule.utils.DroolsRuleLog;
import com.tansun.rule.utils.MClass;

/**
 * 测试服务
 *
 * @author lixs
 */
public interface RuleTestService extends RuleBaseService<RuleTest> {

    /**
     * 查询引用数据集和变量
     */
    TestDataModeVO findDataModeVO(String projectCode, String code, String type, String version) throws BizException;

    /**
     * 保存测试信息
     */
    RuleTest saveOrUpdate(RuleTestVO ruleTest) throws BizException;


    /**
     * @param projectCode
     * @param code
     * @param version
     * @return
     * @exception Exception
     */
    String showRuleDrl(String projectCode,String code,String version) throws Exception;

    
    /**
     * 执行drl测试
     */
    Map<String, Object> testRule(RuleTestMap testInfo, Map<String, Object> inputMap, String string,List<Map<String,Object>> inputPram) throws BizException;

    /**
     * 查询测试信息
     */
    RuleTestVO findRuleTestVO(String id) throws BizException;


    void delRuleTest(String id) throws BizException;

    RuleBatchResult testBatchRule(RuleTestMap testInfo, List<Map<String, Object>> inputMaps) throws BizException;
    /**
     * 获取规则轨迹信息
     * @param drlLog
     * @return
     */
    public Map<String,List> getTrailMap(DroolsRuleLog drlLog);
    /**
     * 将Double格式化
     * @param insertMap
     * @param metaMap
     */
    public void doRuleResultDoubleParse(Map<String, Object> insertMap,Map<String, MClass> metaMap);
    /**
     * 获取挑战者信息
     * @param manageId 
     * @param drlLog
     * @return
     */
	String selectChallengerInfo(String version, String projectCode, String manageId)throws BizException;

}
